NewSessionParameters no longer constructable as of webdriver crate 0.51+

7 views
Skip to first unread message

Jon Gjengset

unread,
Mar 24, 2025, 4:11:43 PMMar 24
to dev-we...@mozilla.org
The 0.51 release of the Rust webdriver crate dropped support for legacy
session construction. However, in the process,
`webdriver::command::NewSessionParameters` was changed from an `enum` to
a `struct`. In Rust, the internals of an `enum` are always public,
whereas the fields of a `struct` are not, but in the move from `enum` to
`struct`, the new `capabilities` field was not marked as `pub`. This
means it's no longer possible to construct a `NewSessionParameters` in
code that uses the `webdriver` crate. This in turn blocks crates like
fantoccini[1], which implements a WebDriver _client_ using `webdriver`
and thus needs to construct these types, not just deserialize them, from
upgrading to any 0.51+ version of `webdriver`.

I recommend the `capabilities` field be make `pub` to rectify this.

Cheers,
Jon

[1]: https://docs.rs/fantoccini/
Reply all
Reply to author
Forward
0 new messages